package HomeWork2;

import java.util.Scanner;

class Book{
    int BookNum =0;
    String BookName = null;
    double BookPrice = 0.0;
    public Book(int BookNum, String BookName,double BookPrice){
        this.BookNum = BookNum;
        this.BookName = BookName;
        this.BookPrice = BookPrice;
    }
    void show(){
        System.out.println("图书编号：" + this.BookNum + "\n图书名称：" + this.BookName + "\n图书价格：" + this.BookPrice);
    }
}
public class Test1 {
    public static void main(String[] args) {
        System.out.println("请输入图书数量");
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        Book a[]=new Book[x];
        for (int i = 0; i < a.length; i++) {
            System.out.println("请输入第" + (i+1) + "本图书信息");
            int num = sc.nextInt();
            String name = sc.next();
            double price = sc.nextDouble();
            a[i] = new Book(num,name,price);
        }
        for (int i = 0; i < a.length; i++) {
            System.out.println("第" + (i+1) + "本书的信息为：");
            a[i].show();
        }
    }
}